"""视频模型"""
from sqlalchemy import Column, String, Integer, Text, ForeignKey
from .base import BaseModel


class Video(BaseModel):
    """视频表模型"""
    __tablename__ = "videos"
    
    title = Column(String(255), nullable=False)
    description = Column(Text, nullable=True)
    cover_url = Column(String(255), nullable=True)
    video_url = Column(String(255), nullable=False)
    duration = Column(Integer, nullable=True)
    category_id = Column(Integer, ForeignKey("categories.id"), nullable=False)
    user_id = Column(Integer, ForeignKey("users.id"), nullable=False)
    view_count = Column(Integer, default=0)
    like_count = Column(Integer, default=0)
    collect_count = Column(Integer, default=0)
    comment_count = Column(Integer, default=0)
    status = Column(Integer, default=1)
